class AA(models.Model):
    a = models.CharField(max_length=5)
    b = models.CharField(max_length=5)

class BB(models.Model):
    c = models.ForeignKey('A')

AA.objects.get(bb__a=a)